import { ref } from "vue";
import { defineStore } from "pinia";
import { getCategoryAPI } from "@/apis/layout";
export const useCategoryStore = defineStore("category", () => {
  // 导航列表的数据管理
  // state 导航列表数据
  const categoryList = ref([]);

  // action 获取导航数据的方法
  const getCategory = async () => {
    // const res = await getCategoryAPI()
    // categoryList.value = res.result
    categoryList.value = [
      {
        id: "1005000",
        name: "云课堂",
        url: "classroom",
        picture:
          "http://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-05-06/201516e3-25d0-48f5-bcee-7f0cafb14176.png",
        children: [
          {
            id: "1005999003",
            name: "居家生活用品",
            picture:
              "http://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-04-22/7f6a7b20-7902-4b43-b9c5-f33151ef1334.jpg?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "1008017",
            name: "收纳",
            picture:
              "https://yanxuan.nosdn.127.net/366989e4d730594e86fcd60b5ab19acc.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "1017000",
            name: "宠物食品",
            picture:
              "https://yanxuan.nosdn.127.net/b42a85ef15f856081ea9f49e5f6893e2.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109243003",
            name: "艺术藏品",
            picture:
              "https://yanxuan.nosdn.127.net/9544b81aaa14c26a8038c2365ff3c2bc.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109248004",
            name: "宠物用品",
            picture:
              "https://yanxuan.nosdn.127.net/e766b09029ca00680d1e651b5cdc42bd.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109293000",
            name: "家庭医疗",
            picture:
              "https://yanxuan.nosdn.127.net/3f34039fa8c26e18e2f4fc96ed8cb6de.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109308000",
            name: "中医保健",
            picture:
              "https://yanxuan.nosdn.127.net/2bfba997fd031317caecc4f0bad17569.png?quality=95&imageView",
            children: null,
            goods: null,
          },
        ],
        goods: [
          {
            id: "3997602",
            name: "暖腰暖腹暖胃，蕲艾暖宫腰带",
            desc: "暖宫暖腰暖胃，大面积热敷≈3片暖宝宝",
            price: "49.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/9892cc73945da1591fa5259ad076b23c.jpg",
            orderNum: null,
          },
          {
            id: "3995284",
            name: "新年佳礼，家用SPA多功能按摩床垫",
            desc: "坐卧两用，随时随地做spa，多个场合随你心意",
            price: "599.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/c41003c6df90d7673195dcc2482e13f3.jpg",
            orderNum: null,
          },
          {
            id: "3993828",
            name: "七夕礼物·姐姐同款，穿出自信体态矫姿带",
            desc: "背薄一寸，年轻十岁，时尚百搭，约会职场小心机",
            price: "159.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/a6939f41c48fa9e9c8f7a7ed855351f1.jpg",
            orderNum: null,
          },
          {
            id: "3993481",
            name: "带提手可站立炫彩硅胶热水袋",
            desc: "杯型式设计，轻松注水防烫伤",
            price: "35.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/0b120e1c37f312981f4f2242997cc862.png",
            orderNum: null,
          },
          {
            id: "3992367",
            name: "七夕礼物·挺拔身姿，隐形内穿矫姿带",
            desc: "众筹爆品回归，专注矫姿20年，轻松矫正身姿",
            price: "149.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/7d1bc78607a08c088b2a7cdbe88c05af.png",
            orderNum: null,
          },
          {
            id: "3991840",
            name: "消炎镇痛一贴灵医用冷敷贴60贴/盒",
            desc: "mini型尺寸设计性价比更高",
            price: "79.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/d3807695c7d42a0247e308a936201d7c.jpg",
            orderNum: null,
          },
          {
            id: "3987204",
            name: "真空拔罐器",
            desc: "居家养生必备超简便拔罐套装",
            price: "49.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/16222847be7d090eb538a944a7e0b01b.jpg",
            orderNum: null,
          },
          {
            id: "3986121",
            name: "艾灸理疗随时随地，灸疗装置8头/12头",
            desc: "哪里不适灸哪里，全身都可灸",
            price: "99.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/941abaee58a88cb104228fe2c4cfdeb1.png",
            orderNum: null,
          },
          {
            id: "3997974",
            name: "入门首选，语音播报电子血压计",
            desc: "全程语音指导，一键测量，监测心率，贴心守护爸妈健康",
            price: "109.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/8f0c15f981c5cbcb1aa17215a259fa62.png",
            orderNum: null,
          },
        ],
      },
      {
        id: "1005002",
        name: "创意工坊",
        url: "workshop",
        picture:
          "http://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-05-06/cf82e5b4-bf1b-4c68-aa86-96f66e8e5282.png",
        children: [
          {
            id: "1005012",
            name: "南北干货",
            picture:
              "https://yanxuan.nosdn.127.net/9af51a1090fd32f668b14451f06d6e72.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "1036003",
            name: "调味酱菜",
            picture:
              "https://yanxuan.nosdn.127.net/5fae33a840870b487cc903535383bf97.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109201001",
            name: "方便食品",
            picture:
              "https://yanxuan.nosdn.127.net/f9872b4aad6c0a943d45629ac96ee8d3.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109206007",
            name: "米面粮油",
            picture:
              "https://yanxuan.nosdn.127.net/8578759aed2268f7aa8641273cac7cb3.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109264007",
            name: "名酒馆",
            picture:
              "https://yanxuan.nosdn.127.net/91413b1476a0697bb0592609a42d4498.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109285003",
            name: "进口酒",
            picture:
              "https://yanxuan.nosdn.127.net/bf705060f01b60fe9c11c345931b1891.png?quality=95&imageView",
            children: null,
            goods: null,
          },
        ],
        goods: [
          {
            id: "1270008",
            name: "黄金玉粟粥米500克",
            desc: "谷物缤纷，香甜软糯",
            price: "9.90",
            picture:
              "https://yanxuan-item.nosdn.127.net/5f62c7ab543b1152383a0e9941c09bfd.png",
            orderNum: null,
          },
          {
            id: "1269010",
            name: "什锦素食粥米500克",
            desc: "谷香米糯，营养美味",
            price: "9.90",
            picture:
              "https://yanxuan-item.nosdn.127.net/dc4826ddb838d8e17f90402adfa3f4fe.png",
            orderNum: null,
          },
          {
            id: "1135081",
            name: "紫米410克",
            desc: "一年一熟的御田胭脂米",
            price: "19.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/a3c0bb3be38ccf510ecaedb81f5bcd9f.png",
            orderNum: null,
          },
          {
            id: "1135080",
            name: "加量50%不加价，贵州兴仁薏仁米600克",
            desc: "粒粒饱满，颗颗香糯",
            price: "19.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/3e93790bba8db8aab54ee5ba72799567.png",
            orderNum: null,
          },
          {
            id: "1135079",
            name: "免浸泡，12种谷物一次同享，五谷米400克",
            desc: "无需浸泡，同煮同熟",
            price: "9.90",
            picture:
              "https://yanxuan-item.nosdn.127.net/bfe70bd66efe94f2f18061c707d2a097.png",
            orderNum: null,
          },
          {
            id: "1135077",
            name: "加量45%不加价，内蒙古赤峰黄小米700克",
            desc: "赤峰好谷，米香浓郁",
            price: "19.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/564eb51c22d898179b468f5dec52d502.png",
            orderNum: null,
          },
          {
            id: "1135076",
            name: "红小豆450克*3袋",
            desc: "皮薄易煮，粒粒香甜",
            price: "19.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/eaec90be370a438e565e10189b7a390a.png",
            orderNum: null,
          },
          {
            id: "1135075",
            name: "来自东北的“黑珍珠”，黑米470克*3袋",
            desc: "米汁香稠，Q弹醇香",
            price: "19.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/1452cfeb14b5d252fb1ba97b278e9cc3.png",
            orderNum: null,
          },
          {
            id: "3464033",
            name: "冻干藤椒豚骨面74克*12盒",
            desc: "日式风味，汤浓肉鲜，椒麻过瘾",
            price: "79.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/7a5ffe313fe5671709d5a9826f5a83a2.jpg",
            orderNum: null,
          },
        ],
      },
      {
        id: "1010000",
        name: "创客社区",
        url: "community",
        picture:
          "http://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-05-06/33e1f5de-0fdb-4cfa-9ba9-781233024b53.png",
        children: [
          {
            id: "109303000",
            name: "钱包/胸包",
            picture:
              "https://yanxuan.nosdn.127.net/237613bc9c22eb422dade63e3ed7c61a.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109311005",
            name: "女式靴子",
            picture:
              "https://yanxuan.nosdn.127.net/62c5dacf3e0cbe8e4188ccd263358d1a.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109311006",
            name: "女式休闲鞋",
            picture:
              "https://yanxuan.nosdn.127.net/8cd3a76ffffb14e9fe92ad2369117af0.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109311007",
            name: "女式运动鞋",
            picture:
              "https://yanxuan.nosdn.127.net/7be561f2ddc2179a7e116c413636eba9.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109315000",
            name: "11.11购物狂欢",
            picture:
              "https://yanxuan.nosdn.127.net/b29297263032957553d7153b309db74b.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109318003",
            name: "【年末狂欢季】",
            picture:
              "https://yanxuan.nosdn.127.net/8f8092d5bf6a133a8cb59ab7b9f790e9.png?quality=95&imageView",
            children: null,
            goods: null,
          },
        ],
        goods: [
          {
            id: "1621018",
            name: "懒人瘦出好身材，多功能甩脂塑形机",
            desc: "懒人福音居家轻松塑身",
            price: "589.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/540f84174dbf9b98d4072abbd886819e.png",
            orderNum: null,
          },
          {
            id: "1593000",
            name: "软糯似baby肌肤，男式高领纯小山羊绒衫",
            desc: "绒毛取自未满1岁的山羊羊羔",
            price: "559.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/06156761337ba0fd1f8f51470f698b5f.png",
            orderNum: null,
          },
          {
            id: "1555000",
            name: "舒眠真丝眼罩",
            desc: "顺滑真丝，感受舒适睡眠",
            price: "79.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/85432452d5f40c4798c08f1f0beb4a43.png",
            orderNum: null,
          },
          {
            id: "1436033",
            name: "柔软透气，女式精梳棉内裤6条装",
            desc: "爱慕供应商柔软透气",
            price: "125.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/dc30e9603306e59d959e7fac6968244e.jpg",
            orderNum: null,
          },
          {
            id: "1281002",
            name: "轻灵碳素耐用型羽毛球拍单双拍",
            desc: "超轻球拍，运动随心",
            price: "119.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/89cc3ab3e332bb1df5dc20241b5ca4bb.png",
            orderNum: null,
          },
          {
            id: "4001285",
            name: "英伦长柄自动晴雨伞",
            desc: "雨天有情调，英伦风设计，给你好品味",
            price: "40.90",
            picture:
              "https://yanxuan-item.nosdn.127.net/e77b8f4a8ddd1e777394d84347859f7c.png",
            orderNum: null,
          },
          {
            id: "4001126",
            name: "瑜伽裸感女式运动训练紧身裤",
            desc: "面料韧性足，修身又舒适",
            price: "83.90",
            picture:
              "https://yanxuan-item.nosdn.127.net/872275c2e2edacc917e0364065c90121.png",
            orderNum: null,
          },
          {
            id: "4000914",
            name: "恍若没穿鞋，女式轻软舒弹健步鞋2.0",
            desc: "宛若没穿鞋的轻盈，体验更自由的奔跑",
            price: "159.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/feec7bde4d52521ae70ab4c5010ce992.png",
            orderNum: null,
          },
          {
            id: "4000620",
            name: "「一件三穿好过冬」男中长款鹅绒防水外套",
            desc: "一件衣服三种穿法，应对多变天气",
            price: "659.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/aa9e03278e3274a2a83f3f8e7df5ee6f.png",
            orderNum: null,
          },
        ],
      },
      {
        id: "1011000",
        name: "学创互动中心",
        url: "core",
        picture:
          "http://yjy-xiaotuxian-dev.oss-cn-beijing.aliyuncs.com/picture/2021-05-06/b514a526-4010-4ce8-8cb9-757ed382f84a.png",
        children: [
          {
            id: "1020003",
            name: "T恤/polo/衬衫",
            picture:
              "https://yanxuan.nosdn.127.net/1f0089afcec911db7202fbcdae57d5f8.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "1037006",
            name: "儿童鞋",
            picture:
              "https://yanxuan.nosdn.127.net/7fd14a409302391da16970981cacd336.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109243018",
            name: "外套/套装",
            picture:
              "https://yanxuan.nosdn.127.net/773a8777f66c286f97af6d74a27d7fe1.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109243019",
            name: "裤子/裙装",
            picture:
              "https://yanxuan.nosdn.127.net/a8c52cea5f953019484a74883ad8f14b.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109243021",
            name: "连体衣/礼盒",
            picture:
              "https://yanxuan.nosdn.127.net/773677cc0922628152a9b3cbd862426f.png?quality=95&imageView",
            children: null,
            goods: null,
          },
          {
            id: "109243022",
            name: "学步鞋",
            picture:
              "https://yanxuan.nosdn.127.net/9a50280bb69e1c12f557f601cce1c480.png?quality=95&imageView",
            children: null,
            goods: null,
          },
        ],
        goods: [
          {
            id: "4027473",
            name: "新款LOGO印花时尚学步叫叫鞋",
            desc: "软底包头叫叫鞋",
            price: "259.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/841d7669e6cc23cb249f47d8d39fc17c.jpg",
            orderNum: null,
          },
          {
            id: "4027466",
            name: "儿童气泵软底学步二阶段学步鞋",
            desc: "气泵大底学步鞋",
            price: "239.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/19bedfd20a12842b5d7f7b909a62e877.jpg",
            orderNum: null,
          },
          {
            id: "4023738",
            name: "舒适软弹，糖果色儿童网孔透气运动鞋25-30",
            desc: "防踢鞋头，透气网孔更舒适",
            price: "139.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/c437179bc1d0d5ad77a79f15a5c6f166.png",
            orderNum: null,
          },
          {
            id: "4023641",
            name: "防踢鞋头，儿童学步健康机能鞋21-30",
            desc: "包头防踢用心呵护",
            price: "129.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/33ba674fbb13e2380ee8a74371eacf43.jpg",
            orderNum: null,
          },
          {
            id: "4023638",
            name: "抓绒保暖，毛毛虫儿童运动鞋26-30",
            desc: "宝贝上脚活力出街",
            price: "109.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/d917c92e663c5ed0bb577c7ded73e4ec.png",
            orderNum: null,
          },
          {
            id: "4007784",
            name: "婴幼儿童透气网面学步鞋小童鞋4-6码",
            desc: "优质透气网布鞋面，轻盈自在",
            price: "119.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/a9f428091f172db89977a511f6639fec.jpg",
            orderNum: null,
          },
          {
            id: "3998535",
            name: "学步更自如，婴幼童机能学步鞋4-6码",
            desc: "宝宝的第一双鞋，成长不将就",
            price: "109.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/ef01de6dfac9cc4c548f317f2feddafe.jpg",
            orderNum: null,
          },
          {
            id: "3995013",
            name: "时髦出街更亮眼，儿童休闲老爹鞋21-26码",
            desc: "高弹鞋底，行走脚感舒适",
            price: "109.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/088c9f9208b82fa4777336d22faa919d.jpg",
            orderNum: null,
          },
          {
            id: "4023751",
            name: "释放可爱天性，棉毛布造型领哈衣59-90cm",
            desc: "A类婴幼儿标准，安全放心",
            price: "62.00",
            picture:
              "https://yanxuan-item.nosdn.127.net/5e2b5629af983dadbceed483dd677eeb.jpg",
            orderNum: null,
          },
        ],
      },
    ];
  };

  return {
    categoryList,
    getCategory,
  };
});
